package org.bronycorps.mlptss.domain.actor;

import org.bronycorps.mlptss.screen.LevelScreen;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class HighlightActor extends Actor {

	private float alpha = 0f;
	private Texture texture;

	public HighlightActor() {
		super();

		Pixmap pixmap = new Pixmap(LevelScreen.STAGE_WIDTH, 300,
				Format.RGBA8888);
		pixmap.setColor(1, 1, 1, 1);
		pixmap.fill();
		this.texture = new Texture(pixmap);
	}

	@Override
	public void draw(SpriteBatch batch, float parentAlpha) {

		Color color = getColor();
		batch.setColor(color.r, color.g, color.b, color.a * this.alpha);

		batch.draw(this.texture, getX(), getY());
	}

	public float getAlpha() {
		return this.alpha;
	}

	public void setAlpha(float alpha) {
		this.alpha = alpha;
	}

}
